# $Id: PKGBUILD 72422 2012-06-14 07:51:14Z speps $
# Maintainer: Ray Rashif <schiv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>

pkgname=lilv
pkgver=0.22.0
pkgrel=2
pkgdesc="A C library interface to the LV2 plug-in standard"
arch=('i686' 'x86_64')
url="http://drobilla.net/software/lilv/"
license=('custom:ISC')
# sratom depends on sord but lilv has its own version requirements
depends=('python2-numpy' 'sratom>=0.4.6' 'sord>=0.14.0' 'jack')
makedepends=('swig')
optdepends=('bash-completion')
source=("http://download.drobilla.net/$pkgname-$pkgver.tar.bz2")
md5sums=('fd3a14fdaeaba4716b4fef526548a747')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # pick up python2 even when python3 exists
  # (the build system has flaky support for python3) -- TODO: check this again
  export PYTHON="/usr/bin/python2"

  # remove ldconfig --speps
  sed -i "/ldconfig/d" wscript

  python2 waf configure --prefix=/usr \
                        --configdir=/etc \
                        --dyn-manifest \
                        --bindings

  python2 waf build $MAKEFLAGS
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  python2 waf install --destdir="$pkgdir"

  # license
  install -Dm644 COPYING \
    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"

  # move bash completions to proper place; TODO: tell upstream
  cd "$pkgdir"
  mkdir -p usr/share/bash-completion
  mv etc/bash_completion.d usr/share/bash-completion/completions
  rm -r etc
}

# vim:set ts=2 sw=2 et:
